<?php
/**
 * StudentParents form
 *
 * @version $Id: StudentParents.php 73 2010-04-25 00:30:44Z yingkuang.chen@gmail.com $
 * @license New BSD License
 * @uses Zend_Form
 * @package student
 * @subpackage Form
 */
class Student_Form_StudentParents extends Sfs_Form
{

  protected $_arrayData;
    function __construct($options=null){
        $locale = Bootstrap::$config['resources']['locale']['default'];
        $path = dirname(__FILE__)."/../languages/$locale/data.ini";
        $ini = new Zend_Config_Ini($path);
        $this->_arrayData = $ini->get('array_data')->toArray();

        parent::__construct($options);
    }

    /**
     * initialization routine
     *
     * @return void
     */
    public function init()
    {
        $this->setMethod('post');
        $this->addElement('hidden', 'sn', array(
        	'label'      => 'sn',
        	'filters'    => array('StringTrim'),
        	'decorators' => $this->noElementDecorator,
        //	'validators' => array()
        	)
        );
        $this->addElement('text', 'name', array(
        	'label'      => 'name',
        	'required'   => true,
            'size'=>12,
        	'filters'    => array('StringTrim'),
        //	'validators' => array()
        	)
        );

        $this->addElement('text', 'english_name', array(
        	'label'      => 'english_name',
            'size' => 12,
        	'filters'    => array('StringTrim'),
        //	'validators' => array()
        	)
        );
        $this->addElement('text', 'born_year', array(
        	'label'      => 'born_year',
        	//'required'   => true,
        	'size' => 5,
        	'filters'    => array('StringTrim'),
        	'validators' => array('int')
        	)
        );
        $this->addElement('text', 'birthday', array(
        	'label'      => 'birthday',
        	//'required'   => true,
        	 'size' => 12,
        	'filters'    => array('StringTrim'),
        	//'validators' => array('date')
        	)
        );
        $this->addElement('text', 'nationality', array(
        	'label'      => 'nationality',
            'size'=>10,
        	'filters'    => array('StringTrim'),
        //	'validators' => array()
        	)
        );
        $this->addElement('radio', 'denizened', array(
        	'label'      => 'denizened',
        	'filters'    => array('StringTrim'),
             'multiOPtions' => $this->_arrayData['whether'],
        	'separator'=>'&nbsp;'
        //	'validators' => array()
        	)
        );
        $this->addElement('radio', 'alive', array(
        	'label'      => 'alive',
        	'required'   => true,
        	 'multiOPtions' => $this->_arrayData['alive'],
        	'filters'    => array('StringTrim'),
        	'separator'=>'&nbsp;'
        //	'validators' => array()
        	)
        );
        $this->addElement('text', 'identification_number', array(
        	'label'      => 'identification_number',
        	'size'=>12,
        	'filters'    => array('StringTrim'),
        //	'validators' => array()
        	)
        );
        $education_level_arr = $this->_arrayData['education_level'];
        $education_level_arr = array_merge(array(''),$education_level_arr);
        $this->addElement('select', 'education_level', array(
        	'label'      => 'education_level',
        	'filters'    => array('StringTrim'),
            'multiOptions'=> $education_level_arr
        //	'validators' => array()
        	)
        );
        $graduate_kind = $this->_arrayData['graduate_kind'];
        $graduate_kind = array_merge(array(''),$graduate_kind);
        $this->addElement('select', 'graduate_kind', array(
        	'label'      => 'graduate_kind',
        	'filters'    => array('StringTrim'),
            'multiOptions' => $graduate_kind,
        	//'decorators' => $this->noElementDecorator,
        	)
        );
        $this->addElement('text', 'occupation', array(
        	'label'      => 'occupation',
        	'size'=> 12,
        	'filters'    => array('StringTrim'),
        //	'validators' => array()
        	)
        );
        $this->addElement('text', 'organ', array(
        	'label'      => 'organ',
        	'size' => 12,
        	'filters'    => array('StringTrim','StripTags'),
        //	'validators' => array()
        	)
        );
        $this->addElement('text', 'organ_title', array(
        	'label'      => 'organ_title',
        	'size'		=> 12,
        	'filters'    => array('StringTrim','StripTags'),
        //	'validators' => array()
        	)
        );
        $this->addElement('text', 'phone_home', array(
        	'label'      => 'phone_home',
        	'filters'    => array('StringTrim','StripTags'),
            'size' => 10,
        //	'validators' => array()
        	)
        );
        $this->addElement('text', 'phone_office', array(
        	'label'      => 'phone_office',
        	'size' => 10,
        	'filters'    => array('StringTrim','StripTags'),
        //	'validators' => array()
        	)
        );
        $this->addElement('text', 'phone_mobile', array(
        	'label'      => 'phone_mobile',
        	'size' => 10,
        	'filters'    => array('StringTrim','StripTags'),
        //	'validators' => array()
        	)
        );
        $this->addElement('text', 'email', array(
        	'label'      => 'email',
        	'size'   =>  15,
        	'filters'    => array('StringTrim','StripTags'),
        //	'validators' => array()
        	)
        );
        $this->addElement('text', 'website', array(
        	'label'      => 'website',
        	'size'   =>  15,
        	'filters'    => array('StringTrim','StripTags'),
        //	'validators' => array()
        	)
        );

        $this->addElement('hidden', 'student_sn', array(
        	'label'      => 'student_sn',
        	'required'   => true,
        	'filters'    => array('StringTrim','StripTags'),
        'decorators' => $this->noElementDecorator,
        	'validators' => array('int')
        	)
        );

    }


}
